load("//bazel:build.bzl", "redpanda_cc_library")

redpanda_cc_library(
    name = "qdc_monitor_config",
    hdrs = [
        "queue_depth_monitor_config.h",
    ],
    include_prefix = "kafka/server",
    visibility = ["//visibility:public"],
)

redpanda_cc_library(
    name = "server",
    srcs = [
        "client_quota_translator.cc",
        "connection_context.cc",
        "fetch_pid_controller.cc",
        "fetch_session_cache.cc",
        "group.cc",
        "group_manager.cc",
        "group_metadata.cc",
        "group_recovery_consumer.cc",
        "group_router.cc",
        "group_stm.cc",
        "group_tx_tracker_stm.cc",
        "handlers/alter_configs.cc",
        "handlers/alter_partition_reassignments.cc",
        "handlers/api_versions.cc",
        "handlers/client_quotas.cc",
        "handlers/configs/config_response_utils.cc",
        "handlers/create_partitions.cc",
        "handlers/create_topics.cc",
        "handlers/delete_acls.cc",
        "handlers/delete_records.cc",
        "handlers/describe_acls.cc",
        "handlers/describe_configs.cc",
        "handlers/describe_log_dirs.cc",
        "handlers/describe_producers.cc",
        "handlers/describe_transactions.cc",
        "handlers/fetch.cc",
        "handlers/find_coordinator.cc",
        "handlers/handler_interface.cc",
        "handlers/handler_probe.cc",
        "handlers/incremental_alter_configs.cc",
        "handlers/list_offsets.cc",
        "handlers/list_partition_reassignments.cc",
        "handlers/metadata.cc",
        "handlers/offset_for_leader_epoch.cc",
        "handlers/produce.cc",
        "handlers/topics/topic_utils.cc",
        "handlers/topics/types.cc",
        "handlers/txn_offset_commit.cc",
        "logger.cc",
        "member.cc",
        "protocol_utils.cc",
        "quota_manager.cc",
        "requests.cc",
        "rm_group_frontend.cc",
        "server.cc",
        "snc_quota_manager.cc",
        "usage_aggregator.cc",
        "usage_manager.cc",
    ],
    hdrs = [
        "atomic_token_bucket.h",
        "client_quota_translator.h",
        "connection_context.h",
        "coordinator_ntp_mapper.h",
        "errors.h",
        "fetch_metadata_cache.h",
        "fetch_pid_controller.h",
        "fetch_session.h",
        "fetch_session_cache.h",
        "fwd.h",
        "group.h",
        "group_data_parser.h",
        "group_manager.h",
        "group_metadata.h",
        "group_probe.h",
        "group_recovery_consumer.h",
        "group_router.h",
        "group_stm.h",
        "group_tx_tracker_stm.h",
        "handlers/add_offsets_to_txn.h",
        "handlers/add_partitions_to_txn.h",
        "handlers/alter_client_quotas.h",
        "handlers/alter_configs.h",
        "handlers/alter_partition_reassignments.h",
        "handlers/api_versions.h",
        "handlers/configs/config_response_utils.h",
        "handlers/configs/config_utils.h",
        "handlers/create_acls.h",
        "handlers/create_partitions.h",
        "handlers/create_topics.h",
        "handlers/delete_acls.h",
        "handlers/delete_groups.h",
        "handlers/delete_records.h",
        "handlers/delete_topics.h",
        "handlers/describe_acls.h",
        "handlers/describe_client_quotas.h",
        "handlers/describe_configs.h",
        "handlers/describe_groups.h",
        "handlers/describe_log_dirs.h",
        "handlers/describe_producers.h",
        "handlers/describe_transactions.h",
        "handlers/details/leader_epoch.h",
        "handlers/details/security.h",
        "handlers/end_txn.h",
        "handlers/fetch.h",
        "handlers/fetch/fetch_plan_executor.h",
        "handlers/fetch/fetch_planner.h",
        "handlers/fetch/replica_selector.h",
        "handlers/find_coordinator.h",
        "handlers/handler.h",
        "handlers/handler_interface.h",
        "handlers/handler_probe.h",
        "handlers/handlers.h",
        "handlers/heartbeat.h",
        "handlers/incremental_alter_configs.h",
        "handlers/init_producer_id.h",
        "handlers/join_group.h",
        "handlers/leave_group.h",
        "handlers/list_groups.h",
        "handlers/list_offsets.h",
        "handlers/list_partition_reassignments.h",
        "handlers/list_transactions.h",
        "handlers/metadata.h",
        "handlers/offset_commit.h",
        "handlers/offset_delete.h",
        "handlers/offset_fetch.h",
        "handlers/offset_for_leader_epoch.h",
        "handlers/produce.h",
        "handlers/sasl_authenticate.h",
        "handlers/sasl_handshake.h",
        "handlers/sync_group.h",
        "handlers/topics/topic_utils.h",
        "handlers/topics/types.h",
        "handlers/topics/validators.h",
        "handlers/txn_offset_commit.h",
        "latency_probe.h",
        "logger.h",
        "member.h",
        "protocol_utils.h",
        "queue_depth_monitor.h",
        "quota_manager.h",
        "read_distribution_probe.h",
        "request_context.h",
        "response.h",
        "rm_group_frontend.h",
        "sasl_probe.h",
        "server.h",
        "snc_quota_manager.h",
        "usage_aggregator.h",
        "usage_manager.h",
    ],
    implementation_deps = [
        "//src/v/features:enterprise_feature_messages",
    ],
    include_prefix = "kafka/server",
    visibility = ["//visibility:public"],
    deps = [
        ":qdc_monitor_config",
        "//src/v/base",
        "//src/v/bytes",
        "//src/v/bytes:iobuf",
        "//src/v/bytes:iobuf_parser",
        "//src/v/bytes:iostream",
        "//src/v/bytes:scattered_message",
        "//src/v/cloud_storage",
        "//src/v/cluster",
        "//src/v/cluster:state_machine_registry",
        "//src/v/config",
        "//src/v/container:chunked_hash_map",
        "//src/v/container:fragmented_vector",
        "//src/v/container:intrusive",
        "//src/v/features",
        "//src/v/hashing:jump_consistent",
        "//src/v/hashing:xx",
        "//src/v/kafka/data:partition_proxy",
        "//src/v/kafka/protocol",
        "//src/v/kafka/protocol:add_offsets_to_txn",
        "//src/v/kafka/protocol:add_partitions_to_txn",
        "//src/v/kafka/protocol:alter_client_quotas",
        "//src/v/kafka/protocol:alter_configs",
        "//src/v/kafka/protocol:alter_partition_reassignments",
        "//src/v/kafka/protocol:api_versions",
        "//src/v/kafka/protocol:create_acls",
        "//src/v/kafka/protocol:create_partitions",
        "//src/v/kafka/protocol:create_topics",
        "//src/v/kafka/protocol:delete_acls",
        "//src/v/kafka/protocol:delete_groups",
        "//src/v/kafka/protocol:delete_records",
        "//src/v/kafka/protocol:delete_topics",
        "//src/v/kafka/protocol:describe_acls",
        "//src/v/kafka/protocol:describe_client_quotas",
        "//src/v/kafka/protocol:describe_configs",
        "//src/v/kafka/protocol:describe_groups",
        "//src/v/kafka/protocol:describe_log_dirs",
        "//src/v/kafka/protocol:describe_producers",
        "//src/v/kafka/protocol:describe_transactions",
        "//src/v/kafka/protocol:end_txn",
        "//src/v/kafka/protocol:fetch",
        "//src/v/kafka/protocol:find_coordinator",
        "//src/v/kafka/protocol:flex_versions",
        "//src/v/kafka/protocol:heartbeat",
        "//src/v/kafka/protocol:incremental_alter_configs",
        "//src/v/kafka/protocol:init_producer_id",
        "//src/v/kafka/protocol:join_group",
        "//src/v/kafka/protocol:leave_group",
        "//src/v/kafka/protocol:list_groups",
        "//src/v/kafka/protocol:list_offset",
        "//src/v/kafka/protocol:list_partition_reassignments",
        "//src/v/kafka/protocol:list_transactions",
        "//src/v/kafka/protocol:metadata",
        "//src/v/kafka/protocol:offset_commit",
        "//src/v/kafka/protocol:offset_delete",
        "//src/v/kafka/protocol:offset_fetch",
        "//src/v/kafka/protocol:offset_for_leader_epoch",
        "//src/v/kafka/protocol:produce",
        "//src/v/kafka/protocol:sasl_authenticate",
        "//src/v/kafka/protocol:sasl_handshake",
        "//src/v/kafka/protocol:sync_group",
        "//src/v/kafka/protocol:txn_offset_commit",
        "//src/v/kafka/protocol/schemata:alter_client_quotas_request",
        "//src/v/kafka/protocol/schemata:alter_client_quotas_response",
        "//src/v/kafka/protocol/schemata:alter_configs_request",
        "//src/v/kafka/protocol/schemata:alter_configs_response",
        "//src/v/kafka/protocol/schemata:alter_partition_reassignments_request",
        "//src/v/kafka/protocol/schemata:alter_partition_reassignments_response",
        "//src/v/kafka/protocol/schemata:api_versions_request",
        "//src/v/kafka/protocol/schemata:create_acls_request",
        "//src/v/kafka/protocol/schemata:create_partitions_request",
        "//src/v/kafka/protocol/schemata:create_partitions_response",
        "//src/v/kafka/protocol/schemata:create_topics_request",
        "//src/v/kafka/protocol/schemata:create_topics_response",
        "//src/v/kafka/protocol/schemata:delete_acls_request",
        "//src/v/kafka/protocol/schemata:delete_acls_response",
        "//src/v/kafka/protocol/schemata:delete_groups_response",
        "//src/v/kafka/protocol/schemata:describe_acls_request",
        "//src/v/kafka/protocol/schemata:describe_client_quotas_request",
        "//src/v/kafka/protocol/schemata:describe_client_quotas_response",
        "//src/v/kafka/protocol/schemata:describe_groups_response",
        "//src/v/kafka/protocol/schemata:describe_producers_response",
        "//src/v/kafka/protocol/schemata:describe_transactions_request",
        "//src/v/kafka/protocol/schemata:fetch_request",
        "//src/v/kafka/protocol/schemata:incremental_alter_configs_request",
        "//src/v/kafka/protocol/schemata:incremental_alter_configs_response",
        "//src/v/kafka/protocol/schemata:leave_group_response",
        "//src/v/kafka/protocol/schemata:list_groups_response",
        "//src/v/kafka/protocol/schemata:list_partition_reassignments_request",
        "//src/v/kafka/protocol/schemata:list_partition_reassignments_response",
        "//src/v/kafka/protocol/schemata:list_transactions_request",
        "//src/v/kafka/protocol/schemata:metadata_response",
        "//src/v/kafka/protocol/schemata:offset_fetch_response",
        "//src/v/kafka/protocol/schemata:offset_for_leader_epoch_response",
        "//src/v/kafka/protocol/schemata:produce_request",
        "//src/v/metrics",
        "//src/v/model",
        "//src/v/net",
        "//src/v/pandaproxy",
        "//src/v/pandaproxy:config",
        "//src/v/pandaproxy:subject_name_strategy",
        "//src/v/raft",
        "//src/v/random:generators",
        "//src/v/reflection:adl",
        "//src/v/reflection:type_traits",
        "//src/v/resource_mgmt:io_priority",
        "//src/v/rpc",
        "//src/v/security",
        "//src/v/security/audit",
        "//src/v/security/audit:types",
        "//src/v/serde",
        "//src/v/serde:chrono",
        "//src/v/serde:iobuf",
        "//src/v/serde:map",
        "//src/v/serde:optional",
        "//src/v/serde:set",
        "//src/v/serde:vector",
        "//src/v/ssx:abort_source",
        "//src/v/ssx:async_algorithm",
        "//src/v/ssx:future_util",
        "//src/v/ssx:semaphore",
        "//src/v/ssx:sformat",
        "//src/v/ssx:sharded_ptr",
        "//src/v/ssx:sharded_value",
        "//src/v/ssx:thread_worker",
        "//src/v/ssx:when_all",
        "//src/v/storage",
        "//src/v/storage:parser_utils",
        "//src/v/storage:record_batch_builder",
        "//src/v/strings:string_switch",
        "//src/v/strings:utf8",
        "//src/v/utils:absl_sstring_hash",
        "//src/v/utils:ema",
        "//src/v/utils:log_hist",
        "//src/v/utils:mutex",
        "//src/v/utils:named_type",
        "//src/v/utils:queue_depth_control",
        "//src/v/utils:remote",
        "//src/v/utils:rwlock",
        "//src/v/utils:to_string",
        "//src/v/utils:tristate",
        "//src/v/utils:truncating_logger",
        "@abseil-cpp//absl/algorithm:container",
        "@abseil-cpp//absl/container:flat_hash_map",
        "@abseil-cpp//absl/container:flat_hash_set",
        "@abseil-cpp//absl/container:node_hash_map",
        "@abseil-cpp//absl/container:node_hash_set",
        "@boost//:algorithm",
        "@boost//:container",
        "@boost//:container_hash",
        "@boost//:iterator",
        "@boost//:lexical_cast",
        "@boost//:numeric_conversion",
        "@boost//:outcome",
        "@boost//:range",
        "@boost//:uuid",
        "@fmt",
        "@seastar",
    ],
)

redpanda_cc_library(
    name = "errors",
    hdrs = [
        "errors.h",
    ],
    include_prefix = "kafka/server",
    visibility = ["//visibility:public"],
    deps = [
        "//src/v/cluster",
        "//src/v/kafka/protocol",
    ],
)

redpanda_cc_library(
    name = "app",
    srcs = [
        "app.cc",
    ],
    hdrs = [
        "app.h",
    ],
    implementation_deps = [
        ":server",
    ],
    include_prefix = "kafka/server",
    visibility = ["//src/v/redpanda:__pkg__"],
    deps = [
        ":qdc_monitor_config",
        "@seastar",
    ],
)
